import java.util.*;
//队列特性
public class code3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int sum =0;
        Queue<Integer> q = new LinkedList<>();
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if (x%2==0) {
                q.offer(x);
            } else {//奇数不加进去，但是sum先加
                sum+=x;
            }
        }
        //k次操作
        while(k>0) {
            if(q.isEmpty()) break;
            int x = q.poll();
            if(x%2==0) {
                q.offer(x/2);
                k--;
            } else {
                sum += x;
            }
        }
        //统计sum
        while(q.size()>0) {
            int u =q.poll();
            sum += u;

        }
        System.out.println(sum);
    }
}
